package com.vd.ssms.controller;

import java.util.ArrayList;
import java.util.List;

import com.vd.ssms.dao.StudentDAO;
import com.vd.ssms.model.Student;

public class StudentController {
	private StudentDAO studentDAO;
	public void setStudentDAO(StudentDAO studentDAO) {
		this.studentDAO = studentDAO;
	}
	public List<Student> search(String id){
		if(id == null || id.isEmpty()){
			return studentDAO.list();
		}else{
			List<Student> list = new ArrayList<Student>();
			list.add(studentDAO.find(id));
			return list;
		}
	}
}
